import yaml


# path = 'phone_code.yaml'


def load_yaml(path):
    file = open(path, 'r', encoding='utf-8')
    data = yaml.load(file, Loader=yaml.FullLoader)
    print(data)
    return data


def write_yaml(path, data):
    with open(path, 'a', encoding='utf-8') as f:
        try:
            yaml.dump(data, stream=f, allow_unicode=True)
        except Exception as e:
            print(e)


if __name__ == '__main__':
    # data = load_yaml('NewEnrollPhone.yaml')
    # for i in data:
    #     # print(data)
    #     print(i.get('phone'), i.get('token'))
    data = {
        '新用户注册': 'CF.Register',
        '夏日奇遇报名成功': 'Trip.Signup.Suc',
        '庆祝-报名成功': 'QZ.YJBC.CK',
        '庆祝多图展示': 'QZ.DT.IM',
        '庆祝首页展示': 'QZ.FIRST.IM',
        '习题册激励视频成功':'XTCDH.JLSP.SUC',
        '去辅导成绩页展示':'GuideSuki.CJ.IM',
        '习题册兑换': 'XTCDH',
        '上学奇遇阶段解锁成功': 'SXQY.JS.SUC',
        '上学奇遇报名成功': 'Meeting.Signup.Suc',
        '去辅导游戏开始成功': 'GuideSuki.Begin.SUC',
        '上学奇遇-双人模式点击': 'CpGuide.Button.CK',
        '上学奇遇-单人模式点击': 'CpGuide.Button.CK',
        '去下厨做食物成功': 'SXQY.QXC.ZLS.SUC',
        '去下厨支付成功': 'SXQY.QXC.ZF.SUC',
        '上学奇遇-购买零食成功': 'SXQY.QXC.ZF.SUC',
        '上学奇遇考试报名成功': 'SXQY.BMKS.SUC',
        '使用钻石直接破壳成功': 'DHD.PK.SUC',
        '一起better打卡成功': 'YQB.DKSuc.IM',
        '破壳查看激励视频成功': 'DHD.KSP.SUC',
        '破壳做任务成功': 'DHD.ZRW.SUC',
        '抓娃娃点击下抓': 'Zww.catch.CK',
        '数据恢复支付成功': 'DataRecovery.Pay.Suc',
        '家具套装购买成功': 'BUY.TAOZHUANG.SUC',
        '钻石购买家具': 'ZS.BUY.JIAJU',
        '贝壳购买家具': 'BK.BUY.JIAJU',
        '点击完结奇遇': 'Trip.Done.CK',
        '你问我答出题': 'QA.set.CK',
        '你画我猜确认出题': 'confirm.set.CK',
        '你画我猜点击出题': 'set.drawguess.CK'
    }
    write_yaml('../yaml_data/Buried_point.yaml', data)
